<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>后台管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="icon" href="javascript:;">
  <link rel="stylesheet" href="../../resource/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="../../resource/myResource/css/no_read_item.css">
</head>
<style>
</style>
<body>
    <form class="layui-form" action="">
        <input type="hidden" id="id">
        <div class="layui-form-item" style="margin-top:25px">
            <div class="layui-inline" >
                <label class="layui-form-label" style="width:60px">申报人</label>
                <div class="layui-input-inline mydiv">
                    <label id="applicantName" class="layui-form-label myvaluelable"></label>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width:60px">维修地点</label>
                <div class="layui-input-inline mydiv">
                    <label id="repairAddr" class="layui-form-label myvaluelable"></label>
                </div>
            </div>
        </div>

        <div class="layui-form-item" style="margin-top:25px">
            <div class="layui-inline">
                <label class="layui-form-label" style="width:60px">申报时间</label>
                <div class="layui-input-inline mydiv">
                    <label id="addTime"class="layui-form-label myvaluelable"></label>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label" style="width:60px">信息:</label>
                <div class="layui-input-block" style="margin-left:10%;margin-right: 10% ;text-align:left;">
                    <textarea id="questionMsg" placeholder="无报修说明" class="layui-textarea" readonly style="resize: none;"></textarea>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label" style="width:60px">图片:</label>
                <div id="image" class="layui-input-block" style="margin-left:10%;margin-right: 10% ;text-align:left;">
                    <!-- <img style="width: 30%; height: auto;" src="http://justxi.com:9999/2.png" onclick="big(this)">
                    <img style="width: 30%; height: auto;" src="http://justxi.com:9999/2.png" onclick="big(this)">
                    <img style="width: 30%; height: auto;" src="http://justxi.com:9999/2.png" onclick="big(this)"> -->
                </div>
            </div>
        </div>
        <div class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label" style="width:60px">维修师傅</label>
                <div class="layui-input-block"  style="margin-left:10%;margin-right: 10% ;text-align:left;"> 
                    <select id="worker" name="category" lay-verify="required" lay-search="" lay-filter="category">
                    <option value="">直接选择或搜索选择</option>
                    </select>
                </div>
            </div>
        </div>
        <div style="margin-top:50px;margin-bottom: 25px">
            <!-- <button type="button" class="layui-btn layui-btn-danger " style="margin-left:10%" onclick="refuseBtn()">拒绝报修</button> -->
            <button type="button" class="layui-btn layui-btn-normal "style="margin-left:80%" onclick="commitBtn()">提交报修</button>
            <!-- <button type="button" class="layui-btn layui-btn-warm " style="margin-left:3%" onclick="closeSelf()">稍后处理</button> -->
        </div>


    </form>
    <script src="../../resource/jquery/dist/jquery.js"></script>
    <script src="../../resource/layui/layui.js" charset="utf-8"></script>
    <script src="../../resource/myResource/js/base.js"></script>
    <!-- <script src="../..//resource/myResource/js/repaorjs/repair_no_read_item.js"></script> -->
    <script type="text/javascript">
        $(function(){
            var id = GetQueryString("id");
            var type =  GetQueryString("type");
            // alert(type);
        /*填充信息*/
        $.ajax({
            url:head+"/other/searchOtherItem?id="+id,
            dataType:"json",
            type:"GET",
            success:function(redata){
                var data = redata.data.data;
                $.each(redata.data.workerList,function(i,data){
                    var msg = data.name+"：  "+data.work
                    // alert(msg);
                    // debugger;
                    // $("#worker").append("1231321");
                    $("#worker").append('<option value="'+data.id+'">'+msg+'</option>');
                   
                });
                layui.use('table',function(){
                    var util = layui.util;
                    $("#id").text(data.id);
                    $("#applicantName").text(data.applicantName);
                    $("#repairAddr").text(data.repairAddr);
                    $("#addTime").text(util.toDateString(data.addTime*1,"yyyy-MM-dd HH:mm"));  
                    $("#addTime").attr("value",data.addTime);
                    $("#questionMsg").text(data.questionMsg);
                    $.each(data.pic,function(i,data){//添加图片
                        $("#image").append('<img style="width: 30%; height: auto; margin-left:10px" src="'+data+'" onclick="big(this)">');
                    });
                    layui.use(['form', 'layedit', 'laydate'], function(){});
                });
            }
        
        });
        });
        
    </script>
    
    <script>
        function refuseBtn(){
            var id = GetQueryString("id");
            layui.use('table',function(){
                layer.open({
                    type: 2, 
                    title:'详细信息',
                    area: ['100%','100%'],
                    offset:['0','0'],
                    scrollbar: true,
                    content: 'refuse_message_other.html?id='+id,//这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
                    success: function(layero,index){
                    }
                }); 
            });
        }
    </script>
    <script>
        function closeSelf(){
            window.parent.location.reload();
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
            // parent.reload();
        }
        function commitBtn(){
          
                // alert(123);
                // debugger;
                var workerId = $("#worker option:selected").attr('value');
                var id = GetQueryString("id");
                var data={};
                data.id = id;
                data.operationId = getId();
                data.workerId = workerId;
                $.ajax({
                    url:head+"/manager/managerRepair",
                    dataType:"json",
                    type:"POST",
                    data:data,
                    success:function(redata){
                        closeSelf();
                    }
                });
        
        }

    </script>
</body> 
</html>     